home *** CD-ROM | disk | FTP | other *** search
- procedure bsave(filename:string);
-
- {BEAHM 8/10/88}
- {cis 70366,713}
-
- {This procedure is to be used to BSAVE CGA graphics created by
- Turbo Pascal 4.0. You can then use the graphic in a GWBASIC
- or BASICA program, or you can use it with Print Shop, or any other program
- which uses BSAVEd CGA graphics. You will need to initialize the graphics
- with the INITGRAPH procedure in the main program before you try to call
- this procedure.}
-
-
- {$M 40000,0,655360} {you might need to change the heapmax here}
- type
- bspic=array[0..16383] of byte; {BSAVE PICTURE}
-
- var
- ofyle:file of bspic;
- a, {original getimage array}
- b:bspic; {bsave array}
- x:integer;
-
- begin
-
- getimage(0,0,getmaxx,getmaxy,a);
-
-
- b[0]:=$fd;
- b[1]:=$00;
- b[2]:=$b8;
- b[3]:=$00;
- b[4]:=$00;
- b[5]:=$00;
- b[6]:=$40;
-
- {The next two loops are to take care of the
- interlacing of a BSAVEd graphic, and for the 192 bytes
- between the two scans}
-
- for x:=4 to 8003 do
- b[x+3]:=a[x+((x-4) div 80)*80];
-
- for x:=8004 to 16100 do
- b[x+3+192]:=a[x+((x-4) div 80)*80-15920];
-
- assign(ofyle,filename);
- rewrite(ofyle);
- write(ofyle,b);
- close(ofyle);
-
- end;